using StructureMap;
using WebPic.Sample.Comum;
using WebPic.Sample.Modelo;

namespace WebPic.Sample.Aplicacao {
    public static class IoC {
        public static IContainer Initialize() {
            ObjectFactory.Initialize(x => {
                                         x.For(typeof (IUnitOfWork)).LifecycleIs(InstanceScope.Hybrid).Use(typeof (UnitOfWork));
                                         x.For(typeof(IRepository<>)).LifecycleIs(InstanceScope.Hybrid).Use(typeof(Repository<>));
                                     });
            return ObjectFactory.Container;
        }
    }
}